import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';

@Component({
  selector: 'app-login',
  template: `
    <nz-spin nzTip="Loading..."></nz-spin>
  `,
})
export class LoginComponent implements OnInit {
  ngOnInit() {
    const user = JSON.parse(window.name);
    if (user.token) {
      localStorage.setItem('token', user.token);
      localStorage.setItem('user', window.name);
      this.router.navigate(['memberCenter/home']);
    }
  }
  constructor(
    private router: Router,
  ) { }
}
